<template>
  <div>
    <!--  遍历子组件,每条评论铺开,样式在子组件定义  -->
    <!--  遍历子组件,把item传递给子组件  -->
    <TheOneComment v-for="(item,index) in commentsArr" :info="item" :key="index"></TheOneComment>
  </div>
</template>

<script>
// 引入组件(子页面组件)
import TheOneComment from './components/TheOneComment.vue'
// 引入文件(mock数据,模拟从服务端拉取的json数据)
import comments from './comments.js'

export default {
  // 注册组件
  components:{
    TheOneComment
  },
  data(){
    return {
      commentsArr: comments
    }
  },
  methods: {
      sumNum(){
        this.a++
      }
  }
}
</script>

<style>

</style>
